package chap1_1;

import java.io.File;

/**
 * @author https://gitee.com/W_Jun
 * @version 1.0
 * @Description  File构造方法的演示
 */
public class FileDemo01 {
    public static void main(String[] args) {
        //File(String pathname)
        File f1 = new File("D:\\project\\java.txt");//此文件可以不存在
        System.out.println(f1);
        //File类重写了toString方法，所以输出的是 D:\project\java.txt

        //File(String parent, String child)
        File f2 = new File("D:\\project", "java.txt");
        System.out.println(f2);

        //File(File parent, String child)
        File f3 = new File("D:\\project");
        File f4 = new File(f3, "java.txt");
        System.out.println(f4);
    }
}